% For "The Climate Risk Premium" (Lemoine, JAERE, 2020)

% sub_damagenodes_damvar:
% Hard-code quadrature nodes for the damage distribution, as calculated from Fortran90 version of truncated_normal_rule.


switch sqrt(Params.var_logdamage)
    case 0.25 % 5 nodes
        nodes_damage(1:5,1) =   [      -7.061468757630521
            -6.686135353321696
            -6.347231150478436
            -6.008326984132566
            -5.632993725159207            ];
        weights_damage(1:5,1) = [     0.1124110336868469E-01
            0.2219193120889714
            0.5333295471701557
            0.2222351712522531
            0.1127486611993518E-01 ];
        % add in filler last three rows
        nodes_damage(6:8,1) =   [ -6; -6; -6 ];
        weights_damage(6:8,1) = [0; 0 ; 0];
    case 0.5 % 6 nodes
        nodes_damage(1:6,1) =   [         -8.142601510951661
            -7.433915060318619
            -6.809482391150508
            -6.211065623546764
            -5.609588398314241
            -4.993570346227611    ];
        weights_damage(1:6,1) = [         0.1925749501186697E-02
            0.7207764790387292E-01
            0.3677058962856718
            0.4283029937716597
            0.1226593746932750
            0.7328337844333521E-02 ];
        % add in filler last two rows
        nodes_damage(7:8,1) =   [ -6; -6 ];
        weights_damage(7:8,1) = [0 ; 0];
    case 0.75 % 7 nodes
        nodes_damage(1:7,1) =   [       -9.583081025070065
            -8.584504006960824
            -7.723952018401659
            -6.925863424978895
            -6.165443742313021
            -5.448201311409096
            -4.857072757452148      ];
        weights_damage(1:7,1) = [       0.1838625904502400E-03
            0.1293622052268383E-01
            0.1332618777175239
            0.3703031705027404
            0.3450420741130483
            0.1202266338494195
            0.1804616070413377E-01 ];
        % add in filler last row
        nodes_damage(8,1) = -6;
        weights_damage(8,1) = 0;
    case 1 % 8 nodes
        nodes_damage(:,1) =   [    -11.25630931458847
            -9.988422484847362
            -8.909591958011758
            -7.924336960573516
            -7.002002606243566
            -6.140831832912089
            -5.376057599667694
            -4.820921029964663       ];
        weights_damage(:,1) = [    0.1565116986801612E-04
            0.1875848785801470E-02
            0.3372279159748626E-01
            0.1759040488620156
            0.3448160299803057
            0.2928519018931219
            0.1223389946382288
            0.2847473307317190E-01 ];
    case 1.25 % 8 nodes
        nodes_damage(:,1) =   [     -12.55623379283938
            -10.99022182337419
            -9.664016738354201
            -8.461059425516277
            -7.346730516674564
            -6.324179904417922
            -5.442389844839394
            -4.830313396543350  ];
        weights_damage(:,1) = [      0.1120637358920939E-04
            0.1399430694594656E-02
            0.2647191959959619E-01
            0.1477290987925015
            0.3179485618231919
            0.3082527213506246
            0.1544366194430788
            0.4375044192282311E-01
            ];
    case 1.5 % 8 nodes
        nodes_damage(:,1) =   [       -13.84970807982494
            -11.98946516500835
            -10.41976267704440
            -9.003097238749397
            -7.700670227537358
            -6.519597626206065
            -5.520022267699280
            -4.843878905234199   ];
        weights_damage(:,1) = [      0.7985333330911264E-05
            0.1048633670862496E-02
            0.2098744178417697E-01
            0.1253763777534905
            0.2939630508948265
            0.3179574679775650
            0.1820786513185992
            0.5858039126714820E-01 ];
    otherwise
        error('Not hard-coded')
end


clear temp_value;